<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Sl5</title>
	</head>
	<body>
		<template>
			<div id="app">
				<!-- 编程式导航 -->
				<button @click="goHome">去首页</button>
				<button @click="goList">去列表页</button>
			</div>
		</template>
		
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
		<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
		<script src="vue.min.js"></script>
		<script>
			export default{
				name:"App",
				methods:{
					goHome(){
						// 带查询参数
						this.$router.push({path:"home","query:{plan:"private"}"});
					},
					goList(){
						// 字符串形式
						this.$router.push("list");
					}
				}
			};
		</script>
		
		<style>
			#app{
				font-family: "Avenir",Helvetica,Arial,sans-serif;
				text-align: center;
				margin: 30px 40px;
			}
			
			button{
				padding: 8px 15px;
				border-radius: 5px;
				border: none;
				outline: none;
			}
		</style>
	</body>
</html>
